package c.h.a.j0;

import android.location.GpsSatellite;
import android.location.GpsStatus;
import android.location.GpsStatus.Listener;
import c.f.a.a.a.a;
import c.h.a.d0.e;
import c.h.a.j0.q0.c;
import java.util.ArrayList;
import java.util.List;

/* compiled from: TabGPS */
public class t0 implements Listener {
    public final /* synthetic */ q0 a;

    public t0(q0 q0Var) {
        this.a = q0Var;
    }

    public void onGpsStatusChanged(int i) {
        if (!this.a.m0()) {
            q0 q0Var = this.a;
            c cVar = q0Var.j0;
            if (cVar != null) {
                cVar.h.setText(q0Var.m0);
            }
            q0Var = this.a;
            q0Var.Z = q0Var.W.getGpsStatus(q0Var.Z);
            q0Var = this.a;
            GpsStatus gpsStatus = q0Var.Z;
            if (gpsStatus != null) {
                Iterable<GpsSatellite> satellites = gpsStatus.getSatellites();
                for (List list : q0Var.h0.values()) {
                    if (list != null) {
                        list.clear();
                    }
                }
                for (GpsSatellite gpsSatellite : satellites) {
                    e eVar = new e();
                    gpsSatellite.getAzimuth();
                    gpsSatellite.getSnr();
                    gpsSatellite.getElevation();
                    eVar.a = a.r(gpsSatellite.getPrn());
                    gpsSatellite.getPrn();
                    List list2 = (List) q0Var.h0.get(Integer.valueOf(eVar.a));
                    if (list2 == null) {
                        list2 = new ArrayList();
                        q0Var.h0.put(Integer.valueOf(eVar.a), list2);
                    }
                    list2.add(eVar);
                }
            }
            q0.s0(this.a);
            if (i == 3) {
                q0 q0Var2 = this.a;
                GpsStatus gpsStatus2 = q0Var2.Z;
                if (gpsStatus2 != null) {
                    q0.t0(q0Var2, gpsStatus2.getTimeToFirstFix());
                }
            }
        }
    }
}
